<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/menuAplicacionNovedades.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListTblprestamosTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form id="form">

                <h:outputText escape="false" value="#{bundle.ListTblprestamosEmpty}" rendered="#{tblprestamosController.items.rowCount == 0}"/>
                <p:panel  id="panel" rendered="#{tblprestamosController.items.rowCount > 0}" header="#{bundle.ListTblprestamosTitle}"  style="panel">
                    <p:messages id="msgs"/>
                    <p:dataTable value="#{tblprestamosController.items}" var="item"paginator="true" rows="10">
                        <p:column sortBy="#{item.consecutivos}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_consecutivos}"/>
                            </f:facet>
                            <h:outputText value="#{item.consecutivos}"/>
                        </p:column>
                        <p:column sortBy="#{item.ideEmp}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_ideEmp}"/>
                            </f:facet>
                            <h:outputText value="#{item.ideEmp}"/>
                        </p:column>
                        <p:column sortBy="#{item.nomEmp}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_nomEmp}"/>
                            </f:facet>
                            <h:outputText value="#{item.nomEmp}"/>
                        </p:column>
                        <p:column sortBy="#{item.referencia}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_referencia}"/>
                            </f:facet>
                            <h:outputText value="#{item.referencia}"/>
                        </p:column>
                        <p:column sortBy="#{item.conceptoPrestamo}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_conceptoPrestamo}"/>
                            </f:facet>
                            <h:outputText value="#{item.conceptoPrestamo}"/>
                        </p:column>
                        <p:column sortBy="#{item.fechaPrestamo}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_fechaPrestamo}"/>
                            </f:facet>
                            <h:outputText value="#{item.fechaPrestamo}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>
                        <p:column sortBy="#{item.montoInicial}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_montoInicial}"/>
                            </f:facet>
                            <h:outputText value="#{item.montoInicial}"/>
                        </p:column>
                        <p:column sortBy="#{item.periodos}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_periodos}"/>
                            </f:facet>
                            <h:outputText value="#{item.periodos}"/>
                        </p:column>
                        <p:column sortBy="#{item.interes}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_interes}"/>
                            </f:facet>
                            <h:outputText value="#{item.interes}"/>
                        </p:column>
                        <p:column sortBy="#{item.valorCuota}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_valorCuota}"/>
                            </f:facet>
                            <h:outputText value="#{item.valorCuota}"/>
                        </p:column>
                        <p:column sortBy="#{item.valorInteres}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_valorInteres}"/>
                            </f:facet>
                            <h:outputText value="#{item.valorInteres}"/>
                        </p:column>
                        <p:column sortBy="#{item.valorAbono}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_valorAbono}"/>
                            </f:facet>
                            <h:outputText value="#{item.valorAbono}"/>
                        </p:column>
                        <p:column sortBy="#{item.saldo}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_saldo}"/>
                            </f:facet>
                            <h:outputText value="#{item.saldo}"/>
                        </p:column>
                        <p:column sortBy="#{item.fechaComienzo}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_fechaComienzo}"/>
                            </f:facet>
                            <h:outputText value="#{item.fechaComienzo}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>
                        <p:column sortBy="#{item.codCompania}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_codCompania}"/>
                            </f:facet>
                            <h:outputText value="#{item.codCompania}"/>
                        </p:column>
                        <p:column sortBy="#{item.idEstado}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTblprestamosTitle_idEstado}"/>
                            </f:facet>
                            <h:outputText value="#{item.idEstado}"/>
                        </p:column>
                        <p:column>
                            <p:commandButton action="#{tblprestamosController.prepareEdit}" value="#{bundle.ListTblprestamosEditLink}"/>

                            <p:commandButton action="#{tblprestamosController.destroy}" update=":form" value="#{bundle.ListTblprestamosDestroyLink}"/>
                        </p:column>
                    </p:dataTable>
                    </p:panel>

                    <p:commandButton action="#{tblprestamosController.prepareCreate}" value="#{bundle.ListTblprestamosCreateLink}"/>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
